<?php

/*
Process Edit Pages (admin_edit_pages.pro.php)
*/

$rank_check = "7";
include "../global.inc.php";

$check = fetch("SELECT id FROM game_pages2 WHERE id = '$edit' AND game = '$game'");

if ((!$page_title) OR (!$page_content))
{
	die(header(error("admin_edit_pages.php?game=$game", "Please do not leave any information blank!")));
}

if (!$check[id])
{
	die(header(error("admin_edit_pages.php?game=$game", "That page does not exsist in your game.")));
}
else
{
	mysql_query("UPDATE game_pages2 SET page_title = '$page_title' WHERE game = '$game' AND id = '$edit'");
	mysql_query("UPDATE game_pages2 SET content = '$page_content' WHERE game = '$game' AND id = '$edit'");
	mysql_query("UPDATE game_pages2 SET login_required = '$login_required' WHERE game = '$game' AND id = '$edit'");

	header("Location: admin_edit_pages.php?game=$game&error=The+page+$page_title+has+been+edited!");
}

?>
